// Include files.
#include "RobotController.hpp"

/**
 *  Constructor for RobotController.
 */
RobotController::RobotController() :
	m_isActive(false)
{
}

/**
 *  Destructor for RobotController.
 */
RobotController::~RobotController()
{
}

/**
 *  Get whether the controller is active.
 *  
 *  @return Whether the controller is active.
 */
bool RobotController::GetIsActive() const
{
	return m_isActive;
}

/**
 *  Activates the controller.
 */
void RobotController::Activate()
{
	if (!m_isActive)
	{
		HandleActivate();
		m_isActive = true;
	}
}

/**
 *  Deactivates the controller.
 */
void RobotController::Deactivate()
{
	HandleDeactivate();
	m_isActive = false;
}

/**
 *  This function should be overridden to activate the controller.
 */
void RobotController::HandleActivate()
{
}

/**
 *  This function should be overridden to deactivate the controller.
 */
void RobotController::HandleDeactivate()
{
}

/**
 *  This function should be overridden to handle the periodic controller tasks.
 *  It will be called periodically when the this controller is active.
 */
void RobotController::HandlePeriodic()
{
}

/**
 *  This function should be overridden to handle the continuous controller tasks.
 *  It will be called as often as possible when this controller is active.
 */
void RobotController::HandleContinuous()
{
}

/**
 *  This function should be overridden to handle the event when the controller is added to the SystematicRobot.
 *  It will be called as often as possible when this controller is active.
 */
void RobotController::HandleAddedToRobot(SystematicRobot &robot)
{
}
